In computer graphics, a scene can include a set of two-dimensional (“2D”) objects and/or three-dimensional (“3D”) objects. A description of the scene (sometimes called a scene file) may include details about the geometry of objects in the scene, texture of objects in the scene, lighting in the scene, and shading of objects in the scene. To view the scene, an image of the scene is “rendered” by generating the image from the objects in a scene. A rendering tool (sometimes called a rendering engine or renderer) processes the description of a scene and outputs an image from a particular vantage point or perspective.
To account for the effects of lighting in a scene, a rendering tool may perform complex calculations to model the behavior of light emitted by a (virtual) light source until that light reaches a virtual camera (light sensor), which yields the rendered image. For example, the rendering tool may track the light paths of rays of light emitted by a light source within a scene, following the light paths as they are reflected between surfaces in the scene, until the light paths reach the virtual camera. At the virtual camera, light paths that reach a given pixel of the rendered image are integrated into a single light intensity value for that pixel (e.g., for a red (R) value, green (G) value, or blue (B) value at a position). Thus, the intensity value for the pixel aggregates light of any light paths directly from the light source to the virtual camera at the pixel, light of any light paths reflected by a single surface before reaching the virtual camera at the pixel, and light for any light paths reflected between multiple surfaces in the scene before reaching the virtual camera at the pixel. Depending on the sophistication of the rendering tool, the rendering tool may account for multiple light sources, ambient light in the scene, and complex effects such as light scattering at surfaces in the scene.